package com.chinamoney.wppm.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.chinamoney.wppm.service.EformService;
import com.chinamoney.wppm.util.ResultMessage;

/**
 * 
 * @author Jason_Jiang
 *
 */
@RestController
public class BdmController {

	
	@Autowired
	private EformService eformService;
	
	/**
	 * 获取需求变更单的花费
	 * @param name
	 * @return
	 */
	@GetMapping("bdm/dc/{name}")
	public ResultMessage<?> getDemandChangeCost(@PathVariable("name") String name) {
		return eformService.getDemandChangeCost(name);
	}
	
	/**
	 * 根据ID获取部门预算
	 * @param id
	 * @return
	 */
	@GetMapping("bdm/{id}")
	public ResultMessage<?> getBdmById(@PathVariable("id") String id) {
		return eformService.getBdmById(id);
	}
	
	/**
	 * 获取所有部门预算管理
	 * @param limit
	 * @param offset
	 * @return
	 */
	@GetMapping("bdm")
	public ResultMessage<?> getBdm(Integer limit, Integer offset) {
		return eformService.getBdm(limit, offset);
	}
	
	
	
	@GetMapping("bdm/echart")
	public Map<String, Object> getBdmByDept(String dept) {
		return eformService.getBdmByDept(dept);
	}
	
}
